package top.mcwebsite.playandroid.lib.common.ext

import android.content.res.Configuration
import android.os.Build

fun Configuration.isNightModeActiveEx(): Boolean {
    return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
        isNightModeActive
    } else {
        (uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
    }
}